blob: 08fbd5caa6ff48ca07b3df2b851eb1fc9290458a [file] [log] [blame]
Shawn O. Pearce6e752212009-08-12 12:22:12 -07001gerrit create-project
2=====================
3
4NAME
5----
6gerrit create-project - Create a new hosted project
7
8SYNOPSIS
9--------
10[verse]
11'ssh' -p <port> <host> 'gerrit create-project' \
12\--name <NAME> \
13[\--owner <OWNER>] \
14[\--description <DESC>] \
15[\--submit-type <TYPE>] \
16[\--use-contributor-agreements {true|false}] \
17[\--use-signed-off-by {true|false}]
18
19DESCRIPTION
20-----------
21Creates a new bare Git repository under `gerrit.basePath`, using
22the project name supplied. The newly created repository is empty
23(has no commits), but is registered in the Gerrit database so that
24the initial commit may be uploaded for review, or initial content
25can be pushed directly into a branch.
26
27If replication is enabled, this command also connects to each of
28the configured remote systems over SSH and uses command line git
29on the remote system to create the empty repository.
30
31
32ACCESS
33------
34Caller must be a member of the privileged 'Administrators' group.
35
36SCRIPTING
37---------
38This command is intended to be used in scripts.
39
40OPTIONS
41-------
42\--name::
43Required; name of the project to create. If name ends with
44`.git` the suffix will be automatically removed.
45
46\--owner::
47Name of the group which will initially own this repository.
48The specified group must already be defined within Gerrit.
49Only one group can be specified on the command line.
50To specify additional owners, add the additional owners
51through the web interface after project creation.
52+
53Defaults to `Administrators` if not specified.
54
55\--description::
56Initial description of the project. If not specified,
57no description is stored.
Shawn O. Pearceea6fc172009-09-18 15:40:38 -070058+
59Description values containing spaces should be quoted in single quotes
60(\'). This most likely requires double quoting the value, for example
61`\--description "\'A description string\'"`.
Shawn O. Pearce6e752212009-08-12 12:22:12 -070062
63\--submit-type::
64Action used by Gerrit to submit an approved change to its
65destination branch. Supported options are:
66+
67* fast-forward-only: produces a strictly linear history.
68* merge-if-necessary: create a merge commit when required.
69* merge-always: always create a merge commit.
70* cherry-pick: always cherry-pick the commit.
71
72+
73Defaults to fast-forward-only. For more details see
74link:project-setup.html#submit_type[Change Submit Actions].
75
76\--use-contributor-agreements::
77If enabled, authors must complete a contributor agreement
78on the site before pushing any commits or changes to this
79project. Disabled by default.
80
81\--use-signed-off-by::
82If enabled, each change must contain a Signed-off-by line
83from either the author or the uploader in the commit message.
84Disabled by default.
85
86
87EXAMPLES
88--------
89Create a new project called `tools/gerrit`:
90
91====
92$ ssh -p 29418 review.example.com gerrit create-project --name tools/gerrit.git
93====
94
Shawn O. Pearceea6fc172009-09-18 15:40:38 -070095Create a new project with a description:
96
97====
98$ ssh -p 29418 review.example.com gerrit create-project --name tool.git --description "'Tools used by build system'"
99====
100
101Note that it is necessary to quote the description twice. The local
102shell needs double quotes around the value to ensure the single quotes
103are passed through SSH as-is to the remote Gerrit server, which uses
104the single quotes to delimit the value.
105
Shawn O. Pearce6e752212009-08-12 12:22:12 -0700106REPLICATION
107-----------
108The remote repository creation is performed by a Bourne shell script:
109
110====
111 mkdir -p '/base/project.git' && cd '/base/project.git' && git init --bare
112====
113
114For this to work successfully the remote system must be able to
115run arbitrary shell scripts, and must have `git` in the user's PATH
116environment variable. Administrators can run this command by hand
117to establish a new empty repository if necessary.
118
119SEE ALSO
120--------
121
122* link:config-replication.html[Git Replication/Mirroring]
123* link:project-setup.html[Project Setup]
124
125GERRIT
126------
127Part of link:index.html[Gerrit Code Review]